<template>
  <div class="goodsdesc-container">
    <h3 class="title">{{ goodsdesc.title }}</h3>
    <hr />
    <div class="content" v-html="goodsdesc.content"></div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      goodsdesc: {},
    };
  },
  created() {
    this.getGoodsDesc();
  },
  methods: {
    async getGoodsDesc() {
      const { data } = await this.$http.get("api/goods/getdesc/" + this.id);
      if (data.status === 0) {
        this.goodsdesc = data.message[0];
      }
    },
  },
  props: ["id"],
};
</script>

<style lang="scss">
.goodsdesc-container {
  padding: 5px;
  .title {
    font-size: 15px;
    text-align: center;
    color: #26a2ff;
  }
  .content {
    img {
      width: 100%;
      height: auto;
    }
  }
}
</style>